package com.itheima.huikebackend.config;

import com.itheima.huikebackend.properties.AliOssProperties;
import com.itheima.huikebackend.utils.AliOssUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author iTaotao
 * @date 2023/7/28 11:30
 * @desciption: 阿里配置
 */
@Configuration
public class AliOssUtilConfiguration {

    @Bean
    public AliOssUtil aliOssUtil(AliOssProperties aliOssProperties) {
        return new AliOssUtil(aliOssProperties.getEndpoint(),
                aliOssProperties.getAccessKeyId(),
                aliOssProperties.getAccessKeySecret(),
                aliOssProperties.getBucketName()
        );
    }

}
